home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / bash1135 / lib / tilde / makefile
Encoding:
Makefile  |  1994-02-20  |  2.7 KB  |  94 lines

  1. ## -*- text -*- ####################################################
  2. #                                   #
  3. # Makefile for the GNU Tilde Library.                   #
  4. #                                   #
  5. ####################################################################
  6.  
  7. # This Makefile is hand made from a template file, found in
  8. # ../template.  Each library must provide several Makefile
  9. # targets: `all', `clean', `documentation', `install', and
  10. # `what-tar'.  The `what-tar' target reports the names of the
  11. # files that need to be included in a tarfile to build the full
  12. # code and documentation for this library.
  13.  
  14. # Please note that the values for INCLUDES, CC, AR, RM, CP,
  15. # RANLIB, and selfdir are passed in from ../Makefile, and do
  16. # not need to be defined here.
  17. RM = rm -f
  18.  
  19. # Here is a rule for making .o files from .c files that doesn't force
  20. # the type of the machine (like -sun3) into the flags.
  21. .c.o:
  22.     $(CC) -c $(CFLAGS) $(INCLUDES) $(LOCAL_DEFINES) $(CPPFLAGS) $*.c
  23.  
  24. # LOCAL_DEFINES are flags that are specific to this library.
  25. # Define -DUSG if you are using a System V operating system.
  26. LOCAL_DEFINES = $(LOCAL_INCLUDES) #-DUSG
  27.  
  28. # For libraries which include headers from other libraries.
  29. LOCAL_INCLUDES = -I../
  30.  
  31. # The name of the library target.
  32. LIBRARY_NAME = libtilde.a
  33.  
  34. # The C code source files for this library.
  35. CSOURCES = tilde.c
  36.  
  37. # The header files for this library.
  38. HSOURCES = tilde.h
  39.  
  40. OBJECTS = tilde.o
  41.  
  42. # The texinfo files which document this library.
  43. DOCSOURCE = doc/tilde.texi
  44. DOCOBJECT = doc/tilde.dvi
  45. DOCSUPPORT = doc/Makefile
  46. DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
  47.  
  48. SUPPORT = Makefile ChangeLog $(DOCSUPPORT)
  49.  
  50. SOURCES  = $(CSOURCES) $(HSOURCES) $(DOCSOURCE)
  51.  
  52. THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
  53.  
  54. ######################################################################
  55.  
  56. all: $(LIBRARY_NAME)
  57.  
  58. $(LIBRARY_NAME): $(OBJECTS)
  59.     $(RM) $@
  60.     $(AR) cr $@ $(OBJECTS)
  61.     -if [ -f "$(RANLIB)" ]; then $(RANLIB) $@; fi
  62.     $(RM) $(patsubst lib%.a,%.olb,$@)
  63.     ln $@ $(patsubst lib%.a,%.olb,$@)
  64.  
  65. what-tar:
  66.     @for file in $(THINGS_TO_TAR); do \
  67.       echo $(selfdir)$$file; \
  68.     done
  69.  
  70. documentation: force
  71.     make -C doc
  72. force:
  73.  
  74. # The rule for 'includes' is written funny so that the if statement
  75. # always returns TRUE unless there really was an error installing the
  76. # include files.
  77. install:
  78.     -$(MV) $(bindir)/$(LIBRARY_NAME) $(bindir)/$(LIBRARY_NAME)-old
  79.     $(CP) $(LIBRARY_NAME) $(bindir)/$(LIBRARY_NAME)
  80.     if [ -f "$(RANLIB)" ]; then $(RANLIB) -t $(bindir)/$(LIBRARY_NAME); fi
  81.  
  82. clean:
  83.     $(RM) $(OBJECTS) $(LIBRARY_NAME)
  84.     make -C doc clean
  85.  
  86.  
  87. ######################################################################
  88. #                                     #
  89. #  Dependencies for the object files which make up this library.     #
  90. #                                     #
  91. ######################################################################
  92.  
  93. tilde.o: tilde.h tilde.c
  94.